#!/bin/bash

$1cron/modifiedTestFirbi.sh $1 $2 $4 $5
ERROR=`grep "Error" output.txt | wc -l`
FAIL=`grep "FAIL" output.txt | wc -l`

if [ "$ERROR" -ne "0" ] || [ "$FAIL" -ne "0" ]
then   
    mail -s 'Daily build failed!' $3 <output.txt
fi